import requests
from config import url, headers_web

class Projects:
    def __int__(self):
        self.url = url
        self.headers = headers_web

    @classmethod
    def get_initialsortprojects(cls,url: str, headers= headers_web, params= None):
        '''
        Summary:获取所有项目(中文首字母排序)
        Description:1、云课堂管理端
        :param url:
        :param headers:
        :param params:
        :return:
        '''
        url = url + "/courseApi/v1/initialsortprojects"
        r = requests.get(url= url,headers= headers, params=params)
        return r

    @classmethod
    def post_addprojects(cls, url: str, headers= headers_web, params= None,json=None):
        '''
        Summary:接口-新增项目
        Description:1、云课堂管理端项目管理使用;2、teachingApi新增实验报告时调用
        :param headers:
        :param params:
        :return:
        '''
        url = url + "/courseApi/v1/projects"
        r = requests.post(url=url,headers=headers,params=params,json=json)
        return r
